$(document).ready(function(){		
	// Accordions
	$('#accordions').accordion({ header: 'strong', animated: 'slide', autoheight: false });
	var accordions = $('#accordions');
	$('#switch select').change(function() { accordions.accordion('activate', this.selectedIndex-1 ); });
	$('#close').click(function() { accordions.accordion('activate', -1); });
	$('#switch2').change(function() { accordions.accordion('activate', this.value); });
	$('#enable').click(function() { accordions.accordion('enable'); });
	$('#disable').click(function() { accordions.accordion('disable'); });
	$('#remove').click(function() { accordions.accordion('destroy'); wizardButtons.unbind('click'); });
	
	// TIPSY DROP  BUTTON
	$('.dbutton').click(function(e) {
		e.preventDefault();
		$('#popup').toggle();
		$('.dbutton').toggleClass('menu-open');
	});

	$('#popup').mouseup(function() { return false});
	
	$(document).mouseup(function(e) {
		if($(e.target).parent('a.dbutton').length==0) {
			$('.dbutton').removeClass('menu-open');
			$('#popup').hide();
		}
	});
	
	// Parse modal vale
	var modal_content = "{modal}";
	
	if (modal_content != "{modal}")
		$('#modal-content').modal(modal_content);
});

	var RecaptchaOptions = {
	    theme : 'custom',
	    custom_theme_widget: 'recaptcha_widget'
	 };